home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / August 96 / Re Undo Set Property < prev    next >
Encoding:
Internet Message Format  |  1996-08-07  |  2.1 KB  |  [TEXT/ttxt]

  1. Subject:     Re:Undo Set Property
  2. Sent:        8/7/96 7:07 AM
  3. Received:    8/7/96 8:55 AM
  4. From:        Serge Froment, sfroment@odyssee.net
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >I'm not sure you need to override FW_CSetPropertyCommand. When a
  9. >FW_CSetPropertyCommand is performed, the SetProperty method of the object
  10. >whose property is being set is called. SetProperty is virtual. I suspect
  11. >you'll be able to implement the functionality you need by override
  12. >SetProperty and/or GetProperty in your part. There is nothing stopping you
  13. >from doing whatever you want when these methods are called. I think this
  14. >method is the most straightforward, and you should be able to do what you
  15. >want.
  16.  
  17. Well, I realize I was not clear. The problem is with Undo support:
  18. FW_CSetPropertyCommand saves the old property and restore it, but it cannot
  19. restore the other properties that are modified as a side effect.
  20.  
  21. >If you _really_ want to mess with FW_CSetProperty command, you'll have to
  22. >do more work. You'll need to override the GetContainedObject method of the
  23. >scriptable object whose property is being set. Within that method, you'll
  24. >need to return a subclass (which you define and implement) of
  25. >FW_CPropertyDesignator, that overrides DoAESetData. When your subclass's
  26. >DoAESetData method is called, you'll have to create and execute either a
  27. >subclass of FW_CSetPropertyCommand, or a subclass of FW_CCommand (that you
  28. >define and implement). This subclass can do whatever you want in its DoIt,
  29. >UndoIt, and RedoIt method. Be _very_ careful to make sure that you
  30. >implement a scheme for reference counting so that objects involved in undo
  31. >are kept around when necessary, and are deleted when you are through with
  32. >them.
  33.  
  34. May I suggest that FW_CPropertyDesignator call a method of FW_CPart to
  35. create the FW_CSetPropertyCommand? If you can do this or something similar
  36. for ODF 2, I will file my incomplete Undo support as a bug to be corrected
  37. once ODF 2 is out.
  38.  
  39. Serge
  40.  
  41. PS: Did you received the message I sent you yesterday at
  42. friedman@cognosis.com regarding adding part properties?
  43.  
  44.  
  45.